package a.e;

import a.c.y;
import a.c.z;
import a.d.w;
import a.j.g;
import a.j.*;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.PathIterator;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Iterator;

public class j
  extends e
{
  private t c;
  private int d;
  private final StringBuffer e = new StringBuffer();
  private boolean f;
  private String g;
  private boolean h;
  private double i = 10.0D;
  private boolean j = true;
  public static int k;
  
  public j()
  {
    a(2);
    b(true);
  }
  
  public void a(g paramg, InputStream paramInputStream)
  {
    throw new UnsupportedOperationException("read operation not supported");
  }
  
  public void a(g paramg, OutputStream paramOutputStream)
    throws IOException
  {
    a(a(paramg), paramOutputStream);
  }
  
  public String a(g paramg)
  {
    int i2 = e.b;
    int i1 = e.a;
    StringBuffer localStringBuffer = new StringBuffer();
    if (this.c != null)
    {
      pg localpg1 = (pg)paramg.fb();
      if (i2 == 0) {}
      pg localpg2 = localpg1 != null ? localpg1 : b(paramg);
      Rectangle localRectangle = localpg2.getVisibleRect();
      double d1 = localRectangle.getX();
      double d2 = localRectangle.getY();
      double d3 = localpg2.M();
      Graphics2D localGraphics2D = (Graphics2D)new BufferedImage(1, 1, 2).getGraphics();
      localGraphics2D.setClip(localRectangle.x, localRectangle.y, localRectangle.width, localRectangle.height);
      z localz1 = new z();
      mb local0 = new mb()
      {
        private final z val$order;
        
        protected void a(Graphics2D paramAnonymousGraphics2D, ld paramAnonymousld)
        {
          this.val$order.c(paramAnonymousld);
        }
        
        protected void a(Graphics2D paramAnonymousGraphics2D, tb paramAnonymoustb)
        {
          this.val$order.c(paramAnonymoustb);
        }
      };
      if (i2 == 0)
      {
        if (localpg1 != null)
        {
          if (i2 != 0) {
            break label201;
          }
          if ((localpg1.W() instanceof mb))
          {
            mb localmb = (mb)localpg1.W();
            local0.c(localmb.f());
          }
        }
        local0.a(localGraphics2D, paramg);
      }
      label201:
      boolean bool = localz1.isEmpty();
      if (i2 == 0)
      {
        if (bool)
        {
          if (i2 != 0) {
            break label272;
          }
          if (this.j) {}
        }
        else
        {
          localStringBuffer.append("<map");
          localStringBuffer.append(" name=\"");
          localStringBuffer.append(this.c.a());
          localStringBuffer.append("\">");
        }
      }
      else {
        localStringBuffer.append(this.g);
      }
      label272:
      label424:
      label617:
      do
      {
        do
        {
          Object localObject2;
          Object localObject3;
          double[] arrayOfDouble;
          do
          {
            if (localz1.isEmpty()) {
              break;
            }
            Object localObject1 = localz1.b();
            do
            {
              double d5;
              double d6;
              if ((localObject1 instanceof ld))
              {
                localObject2 = (ld)localObject1;
                int m = 0;
                do
                {
                  if (m >= ((ld)localObject2).x()) {
                    break;
                  }
                  localObject4 = ((ld)localObject2).b(m);
                  localObject3 = this.c.a(localObject4);
                  if (i1 != 0) {
                    break label424;
                  }
                  if (localObject3 != null)
                  {
                    d5 = ((jg)localObject4).c().d() - d1;
                    d6 = ((jg)localObject4).c().e() - d2;
                    a(d5, d6, d5 + ((jg)localObject4).S(), d6 + ((jg)localObject4).T(), d3, (s)localObject3, localStringBuffer);
                  }
                  m++;
                } while (i1 == 0);
                localObject3 = this.c.a(((ld)localObject2).n());
                if ((i2 != 0) || (localObject3 == null)) {
                  break;
                }
                double d4 = ((ld)localObject2).a() - d1;
                d5 = ((ld)localObject2).b() - d2;
                a(d4, d5, d4 + ((ld)localObject2).c(), d5 + ((ld)localObject2).d(), d3, (s)localObject3, localStringBuffer);
                if ((i2 == 0) && (i1 == 0)) {
                  break;
                }
              }
              if (!(localObject1 instanceof tb)) {
                break;
              }
              localObject3 = (tb)localObject1;
              if ((i2 != 0) || (i1 != 0)) {
                break label810;
              }
              int n = 0;
              do
              {
                if (n >= ((tb)localObject3).V()) {
                  break label617;
                }
                localObject4 = ((tb)localObject3).d(n);
                localObject2 = this.c.a(localObject4);
                if (i1 != 0) {
                  break;
                }
                if (localObject2 != null)
                {
                  d5 = ((ig)localObject4).c().d() - d1;
                  d6 = ((ig)localObject4).c().e() - d2;
                  a(d5, d6, d5 + ((ig)localObject4).S(), d6 + ((ig)localObject4).T(), d3, (s)localObject2, localStringBuffer);
                }
                n++;
              } while (i1 == 0);
              if (i2 != 0) {
                break label272;
              }
              arrayOfDouble = new double[8];
              localObject2 = this.c.a(((tb)localObject3).i());
            } while (i2 != 0);
          } while (localObject2 == null);
          Object localObject4 = ((tb)localObject3).S();
          BasicStroke localBasicStroke = new BasicStroke((float)this.i, 0, 0, 1.41F);
          localObject4 = localBasicStroke.createStrokedShape((Shape)localObject4);
          PathIterator localPathIterator = ((Shape)localObject4).getPathIterator(new AffineTransform());
          z localz2 = new z();
          do
          {
            if (localPathIterator.isDone()) {
              break;
            }
            localPathIterator.currentSegment(arrayOfDouble);
            localz2.add(new w(arrayOfDouble[0] - d1, arrayOfDouble[1] - d2));
            localPathIterator.next();
            if (i2 != 0) {
              break label800;
            }
            if (i1 != 0) {
              break label798;
            }
          } while (i1 == 0);
          if (i2 != 0) {
            break label814;
          }
          a(localz2, d3, (s)localObject2, localStringBuffer);
        } while (i2 != 0);
      } while (i1 == 0);
      label798:
      label800:
      if (bool)
      {
        label810:
        label814:
        if (this.j) {}
      }
      else
      {
        localStringBuffer.append("</map>");
        localStringBuffer.append(this.g);
      }
      if (localpg1 == null) {
        paramg.c(localpg2);
      }
    }
    return localStringBuffer.toString();
  }
  
  public boolean f()
  {
    return this.j;
  }
  
  public void a(boolean paramBoolean)
  {
    this.j = paramBoolean;
  }
  
  public boolean g()
  {
    return this.f;
  }
  
  public void b(boolean paramBoolean)
  {
    int m = e.b;
    if (m == 0)
    {
      this.f = paramBoolean;
      if (paramBoolean)
      {
        if (m != 0) {
          break label39;
        }
        this.g = System.getProperty("line.separator");
        if (e.a == 0) {
          return;
        }
      }
    }
    label39:
    this.g = "";
  }
  
  public void a(double paramDouble)
  {
    this.i = paramDouble;
  }
  
  public double h()
  {
    return this.i;
  }
  
  public int i()
  {
    return this.d;
  }
  
  public void a(int paramInt)
  {
    int i1 = e.b;
    int n = e.a;
    this.d = paramInt;
    this.e.delete(0, this.e.length());
    do
    {
      for (int m = 0; n == 0; m++)
      {
        if (m >= paramInt) {
          break;
        }
        this.e.append(" ");
      }
    } while (i1 != 0);
  }
  
  public pg b(g paramg)
  {
    pg localpg = new pg(paramg);
    Rectangle localRectangle = paramg.d();
    Dimension localDimension = new Dimension(localRectangle.width, localRectangle.height);
    localpg.setSize(localDimension);
    localpg.setPreferredSize(localDimension);
    localpg.c(localRectangle.x - 10, localRectangle.y - 10, localRectangle.width + 20, localRectangle.height + 20);
    return localpg;
  }
  
  public t j()
  {
    return this.c;
  }
  
  public void a(t paramt)
  {
    this.c = paramt;
  }
  
  public boolean c()
  {
    return false;
  }
  
  public String a()
  {
    return "HTML ImageMap";
  }
  
  public String b()
  {
    return "html";
  }
  
  private void a(String paramString, OutputStream paramOutputStream)
    throws IOException
  {
    OutputStreamWriter localOutputStreamWriter = new OutputStreamWriter(paramOutputStream);
    BufferedWriter localBufferedWriter = new BufferedWriter(localOutputStreamWriter);
    localBufferedWriter.write(paramString.toString());
    localBufferedWriter.flush();
    localOutputStreamWriter.flush();
  }
  
  private void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, s params, StringBuffer paramStringBuffer)
  {
    int n = e.b;
    int m = e.a;
    paramStringBuffer.append(this.e);
    paramStringBuffer.append("<area");
    paramStringBuffer.append(" shape=\"rect\"");
    paramStringBuffer.append(" coords=\"");
    paramStringBuffer.append((int)(paramDouble1 * paramDouble5));
    paramStringBuffer.append(",");
    paramStringBuffer.append((int)(paramDouble2 * paramDouble5));
    paramStringBuffer.append(",");
    paramStringBuffer.append((int)(paramDouble3 * paramDouble5));
    paramStringBuffer.append(",");
    paramStringBuffer.append((int)(paramDouble4 * paramDouble5));
    paramStringBuffer.append("\"");
    if (n == 0)
    {
      if (params.b("href"))
      {
        paramStringBuffer.append(" href=\"");
        paramStringBuffer.append(params.a("href"));
        paramStringBuffer.append("\"");
      }
      paramStringBuffer.append(" alt=\"");
      if (n != 0) {}
    }
    else
    {
      if (params.b("alt")) {
        paramStringBuffer.append(params.a("alt"));
      }
      paramStringBuffer.append("\"");
    }
    Iterator localIterator = params.b();
    do
    {
      do
      {
        String str;
        do
        {
          do
          {
            do
            {
              if (!localIterator.hasNext()) {
                break;
              }
              str = (String)localIterator.next();
            } while ("shape".equals(str));
            if ((n != 0) || (m != 0)) {
              break label361;
            }
          } while (("coords".equals(str)) || ((n == 0) && ("href".equals(str))));
          if (n != 0) {
            break;
          }
        } while ("alt".equals(str));
        paramStringBuffer.append(" ");
        paramStringBuffer.append(str);
        paramStringBuffer.append("=\"");
        paramStringBuffer.append(params.a(str));
        paramStringBuffer.append("\"");
      } while (n != 0);
    } while (m == 0);
    if (this.h) {
      label361:
      paramStringBuffer.append('/');
    }
    paramStringBuffer.append(">");
    paramStringBuffer.append(this.g);
  }
  
  private void a(z paramz, double paramDouble, s params, StringBuffer paramStringBuffer)
  {
    int n = e.b;
    int m = e.a;
    paramStringBuffer.append(this.e);
    paramStringBuffer.append("<area");
    paramStringBuffer.append(" shape=\"poly\"");
    paramStringBuffer.append(" coords=\"");
    Object localObject1 = paramz.h();
    do
    {
      do
      {
        do
        {
          if (!((y)localObject1).e()) {
            break;
          }
          localObject2 = (w)((y)localObject1).j();
          paramStringBuffer.append((int)(((w)localObject2).a * paramDouble));
          paramStringBuffer.append(",");
          paramStringBuffer.append((int)(((w)localObject2).b * paramDouble));
          ((y)localObject1).f();
        } while (!((y)localObject1).e());
        paramStringBuffer.append(",");
        if ((n != 0) || (n != 0)) {
          break label173;
        }
        if (m != 0) {
          break label166;
        }
      } while (n != 0);
    } while (m == 0);
    paramStringBuffer.append("\"");
    label166:
    label173:
    if (n == 0)
    {
      if (params.b("href"))
      {
        paramStringBuffer.append(" href=\"");
        paramStringBuffer.append(params.a("href"));
        paramStringBuffer.append("\"");
      }
      paramStringBuffer.append(" alt=\"");
      if (n != 0) {}
    }
    else
    {
      if (params.b("alt")) {
        paramStringBuffer.append(params.a("alt"));
      }
      paramStringBuffer.append("\"");
    }
    Object localObject2 = params.b();
    do
    {
      do
      {
        do
        {
          do
          {
            do
            {
              if (!((Iterator)localObject2).hasNext()) {
                break;
              }
              localObject1 = (String)((Iterator)localObject2).next();
            } while ("shape".equals(localObject1));
            if ((n != 0) || (m != 0)) {
              break label405;
            }
          } while (("coords".equals(localObject1)) || ((n == 0) && ("href".equals(localObject1))));
          if (n != 0) {
            break;
          }
        } while ("alt".equals(localObject1));
        paramStringBuffer.append(" ");
        paramStringBuffer.append((String)localObject1);
        paramStringBuffer.append("=\"");
        paramStringBuffer.append(params.a((String)localObject1));
        paramStringBuffer.append("\"");
      } while (n != 0);
    } while (m == 0);
    if (this.h) {
      label405:
      paramStringBuffer.append('/');
    }
    paramStringBuffer.append(">");
    paramStringBuffer.append(this.g);
  }
  
  public boolean k()
  {
    return this.h;
  }
  
  public void c(boolean paramBoolean)
  {
    this.h = paramBoolean;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.j

 * JD-Core Version:    0.7.0.1

 */